﻿namespace LdtJudge.DataEngine.CallInterface
{
    /// <summary>
    /// 读取相关配置接口
    /// </summary>
    public interface IConfigRetrieval
    {
        /// <summary>
        /// 获取数据库连接信息
        /// </summary>
        /// <param name="connectionName">数据库名称</param>
        /// <returns></returns>
        string GetConnectionString(string connectionName);
        /// <summary>
        /// 修改指定数据库的连接字符串
        /// </summary>
        /// <param name="connectionName">数据库名称</param>
        /// <param name="connectionValue">数据库连接字符串</param>
        /// <returns></returns>
        bool SetConnectionString(string connectionName, string connectionValue);
        /// <summary>
        /// 获取自定义key-value数据信息
        /// </summary>
        /// <param name="appstrkey">key</param>
        /// <returns></returns>
        string GetAppSettingString(string appstrkey);
        /// <summary>
        /// 修改指定key的value值内容
        /// </summary>
        /// <param name="appstrkey">指定key</param>
        /// <param name="appstrkeyValue">对应值</param>
        /// <returns></returns>
        bool SetAppSettingString(string appstrkey, string appstrkeyValue);
        /// <summary>
        /// 重配置中心更新指定产品的所需信息
        /// </summary>
        /// <param name="appstrkey">产品key</param>
        /// <returns></returns>
        bool UpdateAppSettingInfo(string appstrkey);
        /// <summary>
        /// 获取日志路径
        /// </summary>
        /// <returns></returns>
        string GetLogPath();

        /// <summary>
        /// 进行远程获取配置文件内容
        /// </summary>
        /// <param name="sysCode">系统编号，这里目前是wordparse、ldt_judgedocsystem、</param>
        /// <param name="modelPath">模块路径</param>
        /// <param name="fileName">文件名称</param>
        /// <param name="fileType">文件类型</param>
        /// <returns>远程调用获取的内容</returns>
        string GetRemoteFileContent(string sysCode, string modelPath, string fileName, string fileType);
    }
}
